package vip.xiaonuo.modular.business.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import vip.xiaonuo.core.pojo.response.ResponseData;
import vip.xiaonuo.core.pojo.response.SuccessResponseData;
import vip.xiaonuo.modular.business.entity.UserComponentVo;
import vip.xiaonuo.modular.business.service.UserComponentService;
import vip.xiaonuo.modular.manage.poidata.param.PoiDataParam;

import javax.annotation.Resource;

/**
 * @Author: liu
 * @Date:2022/8/23
 */
@Api(tags = "用户配置中心")
@RestController
public class UserComponentController {

    @Resource
    private UserComponentService userComponentService;

    @ApiOperation("组件列表查询")
    @GetMapping("/business/component/list")
    public ResponseData list(){
        return new SuccessResponseData(userComponentService.list());
    }

    @ApiOperation("组件启用停用操作")
    @PostMapping("/business/component/updateEnable")
    public ResponseData updateEnable(@RequestBody UserComponentVo vo){
        return new SuccessResponseData(userComponentService.updateEnable(vo));
    }

    @ApiOperation("商业网点查询")
    @PostMapping("/business/component/commercialPoiQuery")
    public ResponseData commercialPoiQuery(@RequestBody PoiDataParam vo){
        return new SuccessResponseData(userComponentService.commercialPoiQuery(vo));
    }

}
